package adapter;

import adapter.duck.Duck;
import adapter.turkey.RedTurkey;
import adapter.turkey.Turkey;

/**
 * @author zhouyang
 * @title: Main
 * @projectName DesignMode_Java
 * @description: 适配器模式 负责两个抽象类间实体的转换
 * @date 2019/5/28 11:16
 */
public class Main {
    public static void main(String[] args) {
        Turkey turkey = new RedTurkey();
        turkey.fly();
        turkey.gobble();
        //通过适配器模拟鸭子
        Duck fakeDuck = new TurkeyAdapter(turkey);
        fakeDuck.fly();
        fakeDuck.quack();
    }
}
